<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="signupForm">
                        <input id="id" name="id" th:value="${productChannelProfit.id}" type="hidden">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">结算方式1-UV,2-cpm,3-cps：</label>
                            <div class="col-sm-8">
                                <select disabled="disabled" th:field="${productChannelProfit.settlementmethod}"
                                        th:value="${productChannelProfit.settlementmethod}"
                                        id="settlementmethod" name="settlementmethod"
                                        class="form-control">
                                    <option value="1" th:selected="${productChannelProfit.settlementmethod=='1'}">
                                        UV
                                    </option>
                                    <option value="2" th:selected="${productChannelProfit.settlementmethod=='2'}">
                                        CPM
                                    </option>
                                    <option value="3" th:selected="${productChannelProfit.settlementmethod=='3'}">
                                        CPS
                                    </option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group" id="aaaaaa">
                            <label class="col-sm-3 control-label">刊例价格：</label>
                            <div class="col-sm-8">
                                <input maxlength="12" onkeyup="this.value=this.value.replace(/[^\d.]/g,'')"
                                       onafterpaste="this.value=this.value.replace(/[^\d.]/g,'')"
                                       maxlength="12" id="settlementprice" name="settlementprice"
                                       th:value="${productChannelProfit.settlementprice}" class="form-control"
                                       type="text">
                            </div>
                        </div>
                        <div class="form-group" id="bbbbbb">
                            <label class="col-sm-3 control-label">结算比例：</label>
                            <div class="col-sm-8">
                                <input onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"
                                       maxlength="10" id="channelsettlementrate" name="channelsettlementrate"
                                       th:value="${productChannelProfit.channelsettlementrate}"
                                       type="text" placeholder="渠道分成">
                                <input onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"
                                       maxlength="10" id="platformsettlementrate" name="platformsettlementrate"
                                       th:value="${productChannelProfit.platformsettlementrate}"
                                       type="text" placeholder="平台分成">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">广告主PV：</label>
                            <div class="col-sm-8">
                                <input maxlength="10" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"
                                       onafterpaste="value=value.replace(/^(0+)|[^\d]+/g,'')" id="advertiserpv"
                                       name="advertiserpv"
                                       th:value="${productChannelProfit.advertiserpv}" class="form-control" type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">广告主UV：</label>
                            <div class="col-sm-8">
                                <input maxlength="10" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"
                                       onafterpaste="value=value.replace(/^(0+)|[^\d]+/g,'')" id="advertiseruv"
                                       name="advertiseruv"
                                       th:value="${productChannelProfit.advertiseruv}" class="form-control" type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">平台收入：</label>
                            <div class="col-sm-8">
                                <input maxlength="12" onkeyup="value=value.replace(/[^\d.]/g,'')"
                                       onafterpaste="value=value.replace(/[^\d.]/g,'')" id="platformprofit"
                                       name="platformprofit"
                                       th:value="${productChannelProfit.platformprofit}" class="form-control"
                                       type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">优化参数：</label>
                            <div class="col-sm-8">
                                <input maxlength="3" onkeyup="this.value=this.value.replace(/\D/g,'')"
                                       onafterpaste="this.value=this.value.replace(/\D/g,'')" id="optparameters"
                                       name="optparameters"
                                       th:value="${productChannelProfit.optparameters}" class="form-control"
                                       type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">渠道结算金额：</label>
                            <div class="col-sm-8">
                                <input maxlength="20" onkeyup="value=value.replace(/[^\d.]/g,'')"
                                       onafterpaste="value=value.replace(/[^\d.]/g,'')" id="channelsettlementamount"
                                       name="channelsettlementamount"
                                       th:value="${productChannelProfit.channelsettlementamount}" class="form-control"
                                       type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-8 col-sm-offset-3">
                                <button type="submit" class="btn btn-primary">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript" src="/js/appjs/market/productChannelProfit/edit.js">
</script>
<script type="text/javascript" th:inline="javascript">
    $(function () {
        var settlementmethod = $('#settlementmethod').val();
        if (settlementmethod == 1 || settlementmethod == 2) {
            $("#aaaaaa").show();
            $("#bbbbbb").hide();
        } else if (settlementmethod == 3) {
            $("#aaaaaa").hide();
            $("#bbbbbb").show();
        } else {
            $("#aaaaaa").hide();
            $("#bbbbbb").hide();
        }
    })

</script>
</body>
</html>
